import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by HP on 2018/10/2.
 */
public class ServletDemo2 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("post请求转发接收到了");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String name = request.getParameter("name");
        String password = request.getParameter("password");
        String type = request.getParameter("type");
        System.out.println(name+"-----"+password+"-----"+type);
        System.out.println("get请求转发接收到了");
        response.getWriter().write("www");
//        request.getRequestDispatcher("WEB-INF/demo.jsp").forward(request,response);
    }
}
